'use client';
import { SidebarGroup, SidebarMenuButton } from '@/components/ui/sidebar';
import Link from 'next/link';
import { cn } from '@/lib/utils';
import { Plus } from 'lucide-react';
import { NavAgents } from '@/components/sidebar/nav-agents';
import { usePathname } from 'next/navigation';

export default function DashboardSidebar() {
  const pathname = usePathname();

  return (
    <div>
      <SidebarGroup>
        <Link
          href={`/dashboard?agentType=${localStorage.getItem('agentType')}`}
        >
          <SidebarMenuButton
            className={cn({
              'bg-accent text-accent-foreground font-medium':
                pathname === '/dashboard',
            })}
          >
            <Plus className="h-4 w-4 mr-1" />
            <span className="flex items-center justify-between w-full">
              新对话
            </span>
          </SidebarMenuButton>
        </Link>
        {/* Commented-out agents menu */}
      </SidebarGroup>
      <NavAgents />
    </div>
  );
}
